import { ipcRenderer } from 'electron'
import { TaskItem } from '../../renderer/src/types'

const task = {
  getAll: () => ipcRenderer.invoke('tasks-get'),
  add: (task: TaskItem) => {
    ipcRenderer.invoke('tasks-add', task)
  },
  update: (task: TaskItem) => ipcRenderer.invoke('tasks-update', task),
  delete: (id: string) => ipcRenderer.invoke('tasks-delete', id)
}

export default task
